package com.peng.controller;

import com.peng.mapper.UserMapper;
import com.peng.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class UserController {
    @Autowired
    private UserMapper userMapper;

    @RequestMapping("/userList")
    @ResponseBody
    public List<User> userList(){
        List<User> list = userMapper.selectUser();
        return list;
    }

    @RequestMapping("/updateUser")
    @ResponseBody
    public String updateUser(){
        userMapper.updateUser(new User(5,"狂购","222222"));
        return "ok";
    }
}
